package domd1;

import java.util.Arrays;

public class Main {
    public int[] twoSum(int[] nums, int target) {
        int[] result = new int[2];
        int left = 0;
        int right = nums.length - 1;
        for ( left = 0; left < right + 1; left++) {
            for (right = 1; right <nums.length; right++) {
                if (nums[left] + nums[right] == target) {
                    result[0] = left;
                    result[1] = right;
                    return result;
                }
            }

        }
        return result;
    }

    public static void main(String[] args) {
        Main solution=new Main();
        int[] arrays={3,2,4};
      int[] result=solution.twoSum(arrays, 6);
        for (int i = 0; i <result.length ; i++) {
            System.out.print(result[i]);
        }
    }
}